<%@ page language="java" pageEncoding="UTF-8"%>
<div class="container">
	<div class="row">
		<div class="col-sm-9 col-md-9">
			<div class="panel panel-default">
				<div class="panel-body">
					<h3>
						{{discuss.discuss.title}}
						
						<div class="btn-group pull-right" ng-show="discuss.module!=null && discuss.module.length!=0">
							<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
								操作
								<span class="caret"></span>
							</button>
							<ul class="dropdown-menu" role="menu">
								<li ng-repeat="module in discuss.module">
									<a href="javascript:void(0);" ng-click="handle(discuss.discuss,module)">{{module.name}}</a>
								</li>
							</ul>
						</div>
					</h3>
					<hr />
	
					<ol class="breadcrumb">
						<li>
							<a href="#/discuss/forum">讨论</a>
						</li>
						<li>
							<a ng-href="#/discuss/forum/{{discuss.discuss.forum.id}}">{{discuss.discuss.forum.name}}</a>
						</li>
						<li>
							发表于 {{discuss.discuss.create_time | formatDate}}
						</li>
						<li>
							浏览:{{discuss.discuss.views_count}}
							评论:{{discuss.discuss.comment_count}}
						</li>
						<span class="pull-right">
							<span style="cursor: pointer;" ng-click="favorite.create(discuss)" ng-show="discuss.favorite==null || !discuss.favorite" message="'收藏'" tooltip>
								<i class="glyphicon glyphicon-star-empty"></i>
							</span>
							
							<span style="cursor: pointer;" ng-click="favorite.remove(discuss)" ng-show="discuss.favorite" message="'取消收藏'" tooltip>
								<i class="glyphicon glyphicon-star"></i>
							</span>
							收藏 + {{discuss.discuss.favorite_count}}
						</span>
					</ol>
	
					<div>
						<source model="discuss.discuss.content"></source>
					</div>
					
					<div ng-show="discuss.tags!=null && discuss.tags.length!=0">
						<div style="float: left;margin-top: 10px; margin-right: 10px;"><i class="glyphicon glyphicon-tags"></i> 标签:</div>
						<div ng-repeat="tag in discuss.tags" style="float: left; margin-top: 10px; margin-right: 10px;">
							<span class="label label-default">{{tag.content | textOnly | summary:20}} ({{tag.count}})</span>
						</div>
					</div>
				</div>
			</div>
			<div class="panel panel-default">
				<div class="panel-heading">
					<i class="glyphicon glyphicon-comment"></i> 评论
				</div>
				<div class="panel-body">
					<comment id="discuss.discuss.comment_id"></comment>
				</div>
			</div>
			
		</div>
		
		<div class="col-sm-3 col-md-3">
			<user-card uid="discuss.discuss.author.id"></user-card>
			
			<div class="panel panel-default" ng-show="discuss.related!=null && discuss.related.length!=0">
				<div class="panel-heading">
					相关讨论话题
				</div>
				<div class="panel-body">
					<table class="table table-hover">
						<tr ng-repeat="related in discuss.related">
							<td>
								<a ng-href="#/discuss/{{related.id}}" title="{{related.title | textOnly}}">
								{{related.title | textOnly}}
							</a>
							</td>
						</tr>
					</table>
				</div>
			</div>
		</div>
	</div>
</div>